using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class CustmrgMap : EntityTypeConfiguration<Custmrg>
    {
        public CustmrgMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.NAME)
                .HasMaxLength(30);

            this.Property(t => t.CITY)
                .HasMaxLength(21);

            this.Property(t => t.ZIP)
                .HasMaxLength(5);

            this.Property(t => t.PHONE)
                .HasMaxLength(12);

            this.Property(t => t.TAXID)
                .HasMaxLength(15);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Custmrg");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.NAME).HasColumnName("NAME");
            this.Property(t => t.CITY).HasColumnName("CITY");
            this.Property(t => t.ZIP).HasColumnName("ZIP");
            this.Property(t => t.PHONE).HasColumnName("PHONE");
            this.Property(t => t.CUSTDBF).HasColumnName("CUSTDBF");
            this.Property(t => t.TAXID).HasColumnName("TAXID");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
        }
    }
}
